<div class="row animated" ng-class="{true: 'fadeInRight', false:'fadeInLeft'}[currentAnimated]">
  <div class="panel panel-default">
    <div class="panel-heading">
      <a ng-click="discard()" href="javascript:;"><i class="backBtn fa fa-arrow-circle-left"></i></a>
      <span class="panelTitle" ng-bind="Form.title"></span>
    </div>
    <div class="panel-body">
      <form novalidate name="sharepayForm" class="form-horizontal" role="form">
        <div class="form-group" ng-class="{'has-error': sharepayForm.name.$invalid && sharepayForm.name.$dirty}">
          <label class="control-label col-xs-3 col-md-2">砍价商品：</label>
          <div class="col-xs-7 col-md-8">
            <input type="text" class="form-control w25c fl" readonly="readonly" name="artworkId" placeholder="砍价商品" ng-model="sharepay.artworkId" required>
            <button class="btn btn-primary fl" data-toggle="modal" data-target="#chooseProductModal">选择商品</button>
          </div>
        </div>
        <div class="form-group" ng-class="{'has-error': sharepayForm.name.$invalid && sharepayForm.name.$dirty}">
          <label class="control-label col-xs-3 col-md-2">砍价商品名：</label>
          <div class="col-xs-7 col-md-8">
            <input type="text" class="form-control w50c" name="name" placeholder="砍价商品名" ng-model="sharepay.name" required>
          </div>
        </div>
        <div class="form-group" ng-class="{'has-error': sharepayForm.sellPoint.$invalid && sharepayForm.sellPoint.$dirty}">
          <label class="control-label col-xs-3 col-md-2">商品卖点：</label>
          <div class="col-xs-7 col-md-8">
            <input type="text" class="form-control w50c" name="sellPoint" placeholder="商品卖点" ng-model="sharepay.sellPoint">
          </div>
        </div>
        <div class="form-group" ng-class="{'has-error': sharepayForm.difficulty.$invalid && sharepayForm.difficulty.$dirty}">
          <label class="control-label col-xs-3 col-md-2">难度系数：</label>
          <div class="col-xs-7 col-md-8">
            <select class="form-control w50c" name="difficulty" ng-model="sharepay.difficulty" ng-change="changeHardRates()">
              <option value="" key="">----请选择----</option>
              <option ng-repeat="item in sharepay.hardRates" value="{{item.value}}" key="{{item.desc}}">{{item.value}}</option>
            </select>
          </div>
        </div>
        <div class="form-group" ng-class="{'has-error': sharepayForm.secret.$invalid && sharepayForm.secret.$dirty}">
          <label class="control-label col-xs-3 col-md-2">砍价秘诀：</label>
          <div class="col-xs-7 col-md-8">
            <input type="text" class="form-control w50c" name="secret" placeholder="砍价秘诀" ng-model="sharepay.secret">
          </div>
        </div>
       <!--  <div class="form-group" ng-class="{'has-error': sharepayForm.content.$invalid && sharepayForm.content.$dirty}">
          <label class="control-label col-xs-3 col-md-2">分享详情：</label>
          <div class="col-xs-7 col-md-8">
            <textarea name="content" placeholder="分享详情" id="editor" bind-model="sharepay.content" ng-bind-html="sharepay.content | trustHtml" keditor data-config="options" required ng-model="sharepay.contentBody">
            </textarea>
            <autosave module="sharepay" saveId="{{sharepay.id}}" interval="30000"></autosave>
          </div>
        </div> -->
        <div class="form-group" ng-class="{'has-error': sharepayForm.fieldPrice.$invalid && sharepayForm.fieldPrice.$dirty}">
          <label class="control-label col-xs-3 col-md-2">市场价：</label>
          <div class="col-xs-7 col-md-8">
            <input type="number" class="form-control w25c" name="fieldPrice" placeholder="市场价" ng-model="sharepay.fieldPrice" required>
          </div>
        </div>
        <div class="form-group" ng-class="{'has-error': sharepayForm.forwardFee.$invalid && sharepayForm.forwardFee.$dirty}">
          <label class="control-label col-xs-3 col-md-2">每次减价：</label>
          <div class="col-xs-7 col-md-8">
            <input type="number" class="form-control w25c" name="forwardFee" placeholder="减价金额" ng-model="sharepay.forwardFee" required>
          </div>
        </div>
        <div class="form-group" ng-class="{'has-error': sharepayForm.buttomFee.$invalid && sharepayForm.buttomFee.$dirty}">
          <label class="control-label col-xs-3 col-md-2">分享底价：</label>
          <div class="col-xs-7 col-md-8">
            <input type="number" class="form-control w25c" name="buttomFee" placeholder="分享底价" ng-model="sharepay.buttomFee" required>
          </div>
        </div>
        <div class="form-group" ng-class="{'has-error': sharepayForm.cutHours.$invalid && sharepayForm.cutHours.$dirty}">
          <label class="control-label col-xs-3 col-md-2">砍价时长：</label>
          <div class="col-xs-7 col-md-8">
            <input type="number" class="form-control w25c" name="cutHours" placeholder="砍价时长(小时)" ng-model="sharepay.cutHours" required>
          </div>
        </div>
        <div class="form-group" ng-class="{'has-error': sharepayForm.stock.$invalid && sharepayForm.stock.$dirty}">
          <label class="control-label col-xs-3 col-md-2">库存：</label>
          <div class="col-xs-7 col-md-8">
            <input type="number" class="form-control w25c" name="stock" placeholder="库存" ng-model="sharepay.stock" required>
          </div>
        </div>
        <div class="form-group">
          <label class="control-label col-xs-3 col-md-2">产品图：</label>
          <div class="col-xs-7 col-md-8">
            <div class="button btn btn-primary fl" ngf-select="upload($file)" ngf-pattern="'image/*'"
              ngf-accept="'image/*'" ngf-max-size="10MB">上传图片</div>
            <a href="javascript:void(0)" class="btn btn-info ml15" ng-click="openPhotoLibs()">图片库</a><span class="clearfix"></span>
            <bannerlist></bannerlist>
          </div>
        </div>
        <div class="form-group" ng-class="{'has-error': sharepayForm.relates.$invalid && sharepayForm.relates.$dirty}">
          <label class="control-label col-xs-3 col-md-2">关联砍价商品：</label>
          <div class="col-xs-7 col-md-8">
            <div style="padding-bottom: 5px"><button class="btn btn-primary" data-toggle="modal" data-target="#chooseBargainGoods">选择砍价商品</button><button class="btn btn-primary ml15" ng-click="cleanBargainGoods()">清空关联商品</button></div>
            <div class="row" ng-repeat="item in selectedBargainGoods track by $index">
              <div class="col-xs-2 thumbnail" ng-if="item.icon" style="margin-bottom: 8px"><img ng-if="item.icon" ng-src="{{'/ps/download/' + item.icon}}" width="96" border="0"/></div>
              <div class="col-xs-2 thumbnail" ng-if="!item.icon" style="margin-bottom: 8px"><img src="images/defaultIcon.jpg" width="96" border="0"/></div>
              <div class="col-xs-4">{{item.name}}</div>
              <div class="col-xs-2">¥{{item.buttomFee}}</div>
              <div class="col-xs-4"><span class="btn btn-primary" ng-click="removeBargain($index)">删除</span></div>
            </div>
          </div>
        </div>
        <div class="form-group">
          <div class="col-xs-4 col-xs-offset-2">
            <button class="btn btn-primary" ng-click="submitForm()" ng-disabled="sharepayForm.$invalid">保存</button>
            <button class="btn btn-white" ng-click="discard()">取消</button>
          </div>
        </div>
      </form>
    </div>
  </div>
</div>
<imagepreview></imagepreview>
<upload-task></upload-task>

<script src="libs/kindeditor/kindeditor.js" type="text/javascript"></script>
<script src="libs/kindeditor/lang/zh-CN.js" type="text/javascript"></script>